#include <iostream>

class Test{

    public:
    Test() = default;

    // NOTE: constexpr在编译期可以直接使用
    static constexpr int value = 10;
    static constexpr int sum(int a, int b)
    {
        return a+b;
    }

    void print(){
        std::cout << "a" << a << std::endl;
        std::cout << "b" << b << std::endl;
    }

    void modified(){

        // error
        // a = 3;
        c = 2;
        std::cout << "c" << c << std::endl;
    }

    private:
    static constexpr int a = 1;
    static const int b = 1;
    int c = 0;
    // compile error
    //  constexpr int a = 1;
};




int main()
{

    // 编译期直接使用，无需对象
    std::cout << Test::value << std::endl;
    std::cout << Test::sum(1,999) << std::endl;

    Test test;
    test.print();
    test.modified();


}